package graphgenetics;

/*
 * PopulationMember is the type that is used by the Population class to
 * store an array of items.
 * @author Jeremy Mikkola
 */
public interface PopulationMember<T extends PopulationMember>
        extends Comparable<T>  {

    /**
     * This is where a PopulationMember should evaluate its rank.
     * @return The ranks expressed as a double.
     */
    double getRank();

    /**
     * This is where the <strong>current</strong> PopulationMember is
     * <em>replaced</em> by the result of combining the PopulationMemebers
     * a & b.
     * @param a Parent 'a'
     * @param b Parent 'b'
     */
    void combine(T a, T b);

    /**
     * This allows a natural sort order to be applied to the PopulationMembers,
     * so that they can be automatically arranged based on how they should be
     * sorted.
     * @param o The other PopulationMember to compare to.
     * @return the sort order of the two items.
     */
    int compareTo(T o);

    /**
     * Prints any info about the program
     */
    void printInfo();
}
